
<script lang="ts">
// import router from "@/router";
import { defineComponent, ref, onMounted, watch, onUnmounted } from "vue";
import { getNotes } from "../api/hand"
import { showToast } from "vant";
import { useRouter } from "vue-router";
import { useRoute } from "vue-router";
import { getHandVideo } from "../api/hand"
import { getimage } from "../hooks/image"
import { playerTime } from "../hooks/filters"
import { storeToRefs } from 'pinia';
import { useCounterStore } from '../stores/home'
import { useScroll } from "../hooks/useScroll"



export default defineComponent({
    components: {

    },
    setup() {

        let router: any = useRouter();
        let route: any = useRoute();

        let backNoteId: any = route.query.id;
        let backlength: any = route.query.length;

        let istoken = localStorage.getItem('token') != null;
        console.log('istoken=>', istoken)

        const store = useCounterStore()
        const { idarr, likearr, collectlikearr, num, tocked, userInfoheard } = storeToRefs(store);
        console.log("num222222222222222222222222222222", num)
        // 作为 action 的 increment 可以直接解构
        const { changnum, increment, incrementfalse, unlikeFuns, likeFuns, uncommentFuns, commentFuns, getUserInfoFun } = store;
        // 写一条手记的显示与隐藏

        //是否写手记 
        let show1 = ref(true);
        // 是否显示主题topics
        let isTopics = ref(true)

        // 是否显示写笔记的页面
        let iswrite: any = ref(true)

        let towrite = () => {
            istoken = localStorage.getItem('token') != null;
            if (istoken) {
                iswrite.value = !iswrite.value
                show1.value = !show1.value;
            } else {
                showToast('请登录');
                router.push({
                    path: '/register',
                });

            }


        }

        // 遮罩层
        const show = ref(false);

        // 点击手记的文字内容跳转到手记详情页
        let toHanddetail: any = (id: any): any => {
            router.push({
                path: "/handdetail",
                query: { id: id }
            })
        }


        // 点击头像跳路由
        let toOthersInfo: any = (id: any): any => {
            router.push({
                path: '/userdetail',
                query: {
                    userid: id
                }
            })
        }

        // 点击视频封面跳转
        let toVideodetail: any = (aid: any): any => {
            router.push({
                path: '/videoDes',
                query: {
                    aid: aid
                }
            })
        }

        const showShare = ref(false);
        const options = [
            { name: '微信', icon: 'wechat' },
            { name: '微博', icon: 'weibo' },
            { name: '复制链接', icon: 'link' },
            { name: '分享海报', icon: 'poster' },
            { name: '二维码', icon: 'qrcode' },
        ];
        const onSelect = (option: any) => {
            showToast(option.name);
            showShare.value = false;
        };

        // 获取视频的vid
        let vid: any = ref([]);

        // 手记精选列表
        let notesList: any = ref([])
        let dataArr: any = ref([])
        let getHandVideoFun = (item: any, index: number) => {
            let inid = index;
            if (!item) {
                //没有视频
                let obj: any = {};
                obj.index = inid;
                obj.result = undefined;
                dataArr.value.push(obj);
            } else {
                //有视频  
                getHandVideo(item).then((data: any) => {
                    // console.log("getHandVideo=>", data);
                    // console.log("inid",inid);
                    let obj: any = {};
                    obj.index = inid;
                    obj.result = data;
                    dataArr.value.push(obj);
                    // console.log("444444444", dataArr.value);
                })
            }
            let timeID = setInterval(function () {

                // console.log("noteslist.length=>",notesList.value,notesList.value.length);
                // console.log("dataarr.length=>",dataArr.value,dataArr.value.length);
                if (dataArr.value.length == notesList.value.length) {

                    dataArr.value.sort(function (a: any, b: any) {
                        return a.index - b.index;
                    });
                    // console.log("排序后的dataArr=>",dataArr.value);
                    // console.log("相等了")
                    clearInterval(timeID);
                }
            }, 3000)
        }

        let endTopics: any = ref([])
        // 获取数据精选列表方法
        let topics: any = ref([])
        const getNotesFun = () => {
            getNotes({ page: 1 }).then((data: any) => {
                // console.log("getNotes=>",data)
                notesList.value = data.data.list
                // data.data.list.forEach((item: any) => {
                //     notesList.value.push(item);
                // });
                console.log("notesList1=>", notesList);
                notesList.value.forEach((item: any) => {
                    vid.value.push(item.article);

                })
                console.log("vid=>", vid.value)
                vid.value.forEach((item: any, index: number) => {
                    getHandVideoFun(item.vid, index);
                })
                //  拿到过滤后的数组,主题
                // console.log("notesList222222222=>", notesList.value);
                topics.value = notesList.value.filter(function (item: any) {
                    return item.topics

                });

                // console.log("newtopics",newtopics)
                let newtopics: any = []
                topics.value.forEach((item: any, index: any) => {
                    // console.log(item,index)
                    newtopics.push(item.topics)

                })
                console.log("newtopics=>", newtopics)
                let arr: any = [];
                let flag = 0;
                newtopics.forEach((item: any, index: any) => {
                    // console.log(item[0].id)
                    // if(arr.indexOf(item) === -1){
                    //     arr.push(item)
                    // }
                    if (arr.length == 0) {
                        arr.push(item)
                    } else {
                        for (var i = 0; i < arr.length; i++) {
                            if (arr[i][0].id == item[0].id) {
                                // console.log(1);
                                flag = 0;
                                break;
                            } else {
                                // console.log(2);
                                flag = 1;
                            }
                        }
                        if (flag == 1) {
                            arr.push(item);
                        }
                    }
                    // console.log("arr=>", arr);
                    endTopics.value = arr
                    // console.log("endTopics=>",endTopics.value)
                })
                // console.log("topics=>", topics)
            })
        }


        // 点击了主题
        let newArr: any = ref([])
        let toTopics: any = (id: any) => {
            newArr.value = topics.value.filter(function (item: any) {
                return item.topics[0].id == id
            })

            console.log("newArr=>", newArr)
            isTopics.value = !isTopics.value
        }





        // 组件上传
        const fileList = ref([
            // { url: 'https://fastly.jsdelivr.net/npm/@vant/assets/leaf.jpeg' },
            // Uploader 根据文件后缀来判断是否为图片文件
            // 如果图片 URL 中不包含类型信息，可以添加 isImage 标记来声明
            // { url: 'https://cloud-image', isImage: true },
        ]);

        // 手记标题
        let sentNoteTitle = ref(null)

        // 手记内容


        let noteContent: any = document.getElementById('noteContent')

        // 原始笔记id
        let myNoteId = 123456
        let newarr: any = ref([])
        // 存入localstroge
        let localarrjson: any = window.localStorage.getItem("mynoteArr")
        let localarr = JSON.parse(localarrjson);
        let mynoteArr: any = ref(localarr || [])

        let send = () => {
            // if(tocked!==null){
                   console.log(userInfoheard);

            show1.value = !show1.value;
            iswrite.value = true
            let nowTime = new Date().getTime()
            // 笔记id
            myNoteId += 1
            getUserInfoFun();
            mynoteArr.value.push(
                {
                    userId: window.localStorage.getItem("userId"),
                    id: myNoteId,                   //手记id
                    title: sentNoteTitle.value,   //标题
                    images: fileList.value,       //图片
                    content: noteContent.value,   //内容
                    addtime: nowTime,  //时间
                    ip_location: "广东",
                    count: {
                        count_commented: 0,  //评论数
                        count_liked: 0,      //点赞数
                        count_shared: 0,     //分享数
                    },
                    user: {
                        id: 10020974,     //董北的id
                        // avatar: userInfoheard.avatar,  //董北的头像
                        // username: userInfoheard.avatar,  //用户nickname
                    }

                }
            )
            console.log("mynoteArr=>", mynoteArr)
            mynoteArr.value.sort(function (a: any, b: any) {
                return b.addtime - a.addtime
            })
            window.localStorage.setItem("mynoteArr", JSON.stringify(mynoteArr.value)) 
            // }else{
            //     showToast('请登录');
            // router.push({
            //     path: '/register',
            // });

            // }
        
        };

        let isshow = ref(false)
        // 我发的手记大图片
        let mybigpic: any = ref(null)
        // 图片传参数
        let bigpic: any = ref(null)
        let pic = (indexg: any, id: any, indexm: any, type: any) => {
            // console.log("点击官方图片下标=>",indexg)
            // console.log("点击自己图片下标=>",indexm)
            console.log("show=>", show.value)
            console.log("mshow=>", isshow.value)

            // 官方
            if (type == "g") {
                console.log("点击官方图片下标=>", indexg)
                let imgArr = notesList.value.filter((item: any) => {
                    return item.id == id
                })
                // console.log("imgArr=>",imgArr)
                // console.log("imgArr.images=>",imgArr[0].images)
                // console.log(imgArr[0].images[0])
                imgArr[0].images.forEach((item: any, index1: any) => {
                    // console.log("111",index1)
                    if (indexg == index1) {
                        bigpic.value = imgArr[0].images[index1]
                    }
                    // console.log("bigpic.value=>",bigpic.value)
                })
            }
            if (type == "m") {// 自己发的手记
                console.log("点击自己图片下标=>", indexm)
                mynoteArr.value[0].images.forEach((item: any, index2: any) => {
                    // console.log("index1",index1)
                    if (indexm == index2) {
                        mybigpic.value = mynoteArr.value[0].images[index2]
                    }
                    console.log("mybigpic=>", mybigpic.value)
                })
            }


        }

        // 点击自己发的手记跳转
        let toMysendNote: any = (id: any) => {
            router.push({
                path: "/mysendnote",
                query: {
                    id: id
                }
            })
        }

        // 判断是否是vip
        let localvip = JSON.parse(window.localStorage.getItem("vip"))

        let isvip: any = ref(localvip || {})





       







        onMounted(() => {
            getNotesFun();
            noteContent = document.getElementById('noteContent');
            let localjson: any = window.localStorage.getItem("mynoteArr")
            localarr = JSON.parse(localjson);
            istoken = localStorage.getItem('token') != null;
        })
        onUnmounted(() => {
        })

        return {
            options,
            onSelect,
            showShare,
            show1,
            send,
            toHanddetail, //跳转到手记详情
            toOthersInfo, //跳转到其他用户详情页
            toVideodetail, //跳转到视频详情页
            notesList,
            vid,
            dataArr,
            topics,
            toTopics,
            newArr,
            isTopics,
            getimage, //处理图片
            playerTime, //过滤上传时间
            fileList,
            sentNoteTitle,
            newarr,
            towrite, //是否显示写手记的页面
            iswrite,  //默认true
            mynoteArr,
            show, //遮罩层
            pic,
            bigpic,
            mybigpic,
            isshow,
            toMysendNote,
            num,
            backNoteId,
            backlength,
            idarr,
            likearr,
            increment,
            incrementfalse,
            unlikeFuns,
            likeFuns,
            uncommentFuns,
            commentFuns,
            endTopics,
            userInfoheard,
            // text 
            istoken,
            isvip

        }
    },
})


</script>


<template>
    <van-loading size="24px" style="text-align: center;" v-if="!notesList">加载中...</van-loading>
    <div v-show="isTopics">
        <!--  v-if="notesList.length == dataArr.length" -->
        <div class="hande-box" v-if="notesList.length == dataArr.length">

            <div class="hande-title">
                <!-- 向左箭头 -->
                <span class="iconfont icon-xiangzuojiantou" @click="towrite" v-show="!iswrite && !show1"></span>
                <h1 v-show="iswrite">手记</h1>
                <h1 v-show="!iswrite"> 发手记 </h1>


                <span class="iconfont icon-yly_bianji" @click="towrite" v-show="iswrite"> 写一条</span>

                <span class="release" @click="send" v-show="!iswrite && !show1">发布</span>

            </div>

            <div class="empty-div" style="height:52px;background-color:#ffffff"></div>

            <div class="hande-show" v-show="show1 && isTopics">
                <!-- topic 主题的图片 -->
                <div class="hane-rotate" v-if="endTopics.length">
                    <van-swipe class="my-swipe" :loop=false :show-indicators="false" :width="138">
                        <van-swipe-item v-for="(item, index) in endTopics" :key="index">
                            <div class="swipe-img" @click="toTopics(item[0].id)">
                                <img :src="getimage(item[0].icon)">
                                <p>{{ item[0].name }}</p>
                            </div>
                        </van-swipe-item>
                    </van-swipe>
                </div>
                <!-- 手记内容 -->

                <!-- 我的发送的手记内容 -->
                <div class="hande-content" v-for="(item, index) in mynoteArr  " :key="index">
                    <!-- 用户头像 -->
                    <div class="head-pic" v-if="userInfoheard">
                        <!-- 点击头像跳转路由 -->
                        <img :src="userInfoheard.avatar" @click="toOthersInfo(item.user.id)">
                        <div class="user-box">
                            <div class="user-name">
                                <p class="name">{{ userInfoheard.username }} 
                                    <span class="iconfont icon-VIP1" v-if="isvip.Vip==1" ></span> 
                                    <span class="iconfont icon-VIP1" style="color:gold" v-if="isvip.Vip==2"></span>
                                
                                </p>
                                <p class="updata-time">{{ playerTime(item.addtime) }} 发布</p>
                            </div>

                            <div class="flow-box">
                                <span class="flow" v-if="!idarr.includes(item.user.id)||!istoken" @click="increment(item.user.id)">
                                    + 关注 </span>
                                <span class="flow" v-else @click="incrementfalse(item.user.id)"> 已关注 </span>
                                <!-- <span class="iconfont icon-Androidgengduo"></span> -->
                                <van-cell class="iconfont icon-Androidgengduo" @click="showShare = true" />
                            </div>
                        </div>
                    </div>
                    <!-- 手记描述 -->
                    <div class="content-desc">
                        <p class="desc-title" @click="toMysendNote(item.id)">{{ item.title == "" ? '转发了作品' : item.title }}
                        </p>
                        <p class="desc-worlds" @click="toMysendNote(item.id)">
                            <span class="desc-tag" v-if="item.topics"> # {{ item.topics[0].name }} </span>
                            {{ item.content }}
                        </p>
                        <!-- 图片 -->
                        <div class="desc-img">
                            <!-- <div class="img-boc" v-for="(item1, index1) in item.images" :key="index1">
                                <img :src="item1.content">
                            </div> -->

                            <!-- 自己发手记的遮罩层级  -->
                            <van-button class="img-boc" type="primary" v-for="(item1, index2) in item.images" :key="index2"
                                @click="isshow = true; pic('', '', index2, 'm')">
                                <img :src="item1.content">
                            </van-button>

                            <van-overlay class="myoverlay" :show="isshow" @click="isshow = false">
                                <div class="wrapper" @click.stop>
                                    <div class="block" @click="isshow = false">
                                        <img :src="mybigpic.content+'?param=5y5'">
                                    </div>
                                </div>
                            </van-overlay>
                        </div>

                        <!-- 视频 自己发的手记不能发视频 -->
                        <!-- <div class="desc-video" v-if="item.article.vid" >
                            <div class="video-pic" v-if="dataArr[index].result"> -->
                        <!-- 视频封面 点击视频封面跳转到视频详情页 -->
                        <!-- <img :src="getimage(dataArr[index].result.data.cover)+'?params50y50'" @click="toVideodetail(item.article.id)">
                                <span class="iconfont icon-yanjing_xianshi_o"> 8779 </span>
                                <span class="iconfont icon-dianzan1"> 63 </span>
                                <span class="video-time"> 1:30</span>
                            </div>
                            <div class="video-card" v-if="dataArr[index].result">
                                <p class="video-name">{{ dataArr[index].result.data.title }}</p>
                                <p class="video-author">@{{ dataArr[index].result.data.owner.username }}</p>
                            </div>
                        </div> -->

                    </div>
                    <div class="hande-content-btn">
                        <!-- 我发的手记的点赞数 -->
                        <!-- <div class="hande-content-btns">
                            <p class="iconfont icon-dianzan1"> </p> <span> {{ item.count.count_liked }} </span>
                        </div> -->
                        <div class="hande-content-btns" @click.stop="likeFuns(item.id)" v-if="!likearr.includes(item.id)||!istoken">
                            <p class="iconfont icon-dianzan"> </p> <span> {{ item.count.count_liked }} </span>
                        </div>
                        <div class="hande-content-btns" @click.stop="unlikeFuns(item.id)" v-else>
                            <p class="iconfont icon-dianzan_kuai" style="color:red"> </p> <span> {{ item.count.count_liked +
                                1 }} </span>
                        </div>

                        <div class="hande-content-btns">
                            <p class="iconfont icon-review"> </p> <span>{{ num }} </span>
                        </div>
                        <!-- <p class="iconfont icon-fenxiang3"> <span> {{item.count.count_shared}} </span> </p> -->

                        <div class="hande-content-btns">
                            <van-cell class="iconfont icon-fenxiang3" @click="showShare = true" /> <span>
                                {{ item.count.count_shared }} </span>
                        </div>

                        <van-share-sheet v-model:show="showShare" title="立即分享给好友" :options="options" @select="onSelect" />
                    </div>
                </div>

                <!-- 官方的手记精选列表 -->
                <div class="hande-content" v-for="(item, index) in notesList  " :key="index">
                    <!-- 用户头像 -->
                    <div class="head-pic">
                        <!-- 点击头像跳转路由 -->
                        <img :src="getimage(item.user.avatar + '?params50y50')" @click="toOthersInfo(item.user.id)">
                        <div class="user-box">
                            <div class="user-name">
                                <p class="name">{{ item.user.username }} <span class="iconfont icon-VIP1"
                                        v-if="item.user.vip_flag == 1"></span> </p>
                                <p class="updata-time">{{ playerTime(item.addtime * 1000) }} 发布</p>
                            </div>

                            <div class="flow-box">
                                <span class="flow" v-if="!idarr.includes(item.user.id)||!istoken" @click="increment(item.user.id)">
                                    + 关注 </span>
                                <span class="flow" v-else @click="incrementfalse(item.user.id)"> 已关注 </span>
                                <!-- <span class="iconfont icon-Androidgengduo"></span> -->
                                <van-cell class="iconfont icon-Androidgengduo" @click="showShare = true" />
                            </div>
                        </div>
                    </div>
                    <!-- 手记描述 -->
                    <div class="content-desc">
                        <p class="desc-title" @click="toHanddetail(item.id)">{{ item.title == "" ? '转发了作品' : item.title }}
                        </p>
                        <p class="desc-worlds" @click="toHanddetail(item.id)">
                            <span class="desc-tag" v-if="item.topics"> # {{ item.topics[0].name }} </span>
                            {{ item.content }}
                            <!-- <van-text-ellipsis
                                rows="3"
                                :content="text"
                                expand-text="展开"
                                collapse-text="收起"
                            /> -->
                        </p>



                        <!-- 图片 -->
                        <div class="desc-img">
                            <!-- <div class="img-boc" v-for="(item1, index1) in item.images" :key="index1">
                                <img :src="getimage(item1 + '?params50y50')">
                            </div> -->

                            <!-- 遮罩层级 -->
                            <van-button class="img-boc" type="primary" v-for="(item1, index1) in item.images" :key="index1"
                                @click="show = true; pic(index1, item.id, '', 'g')">
                                <img :src="getimage(item1 + '?params50y50')">
                            </van-button>

                            <van-overlay :show="show" @click="show = false">
                                <div class="wrapper" @click.stop>
                                    <div class="block" @click="show = false">
                                        <img :src="bigpic">
                                    </div>
                                </div>
                            </van-overlay>
                        </div>

                        <!-- 视频 -->
                        <div class="desc-video" v-if="item.article.vid">
                            <div class="video-pic" v-if="dataArr[index].result">
                                <!-- 视频封面 点击视频封面跳转到视频详情页 -->
                                <img :src="getimage(dataArr[index].result.data.cover) + '?params50y50'"
                                    @click="toVideodetail(item.article.id)">
                                <!-- <span class="iconfont icon-yanjing_xianshi_o"> 8779 </span>
                                <span class="iconfont icon-dianzan1"> 63 </span>
                                <span class="video-time"> 1:30</span> -->
                                <span class="iconfont icon-shipin2"></span>
                            </div>
                            <div class="video-card" v-if="dataArr[index].result">
                                <p class="video-name">{{ dataArr[index].result.data.title }}</p>
                                <p class="video-author">@{{ dataArr[index].result.data.owner.username }}</p>
                            </div>

                        </div>

                    </div>
                    <div class="hande-content-btn">
                        <!-- 点赞 -->
                        <div class="hande-content-btns" @click.stop="likeFuns(item.id)" v-if="!likearr.includes(item.id)||!istoken">
                            <p class="iconfont icon-dianzan"> </p> <span> {{ item.count.count_liked }} </span>
                        </div>
                        <div class="hande-content-btns" @click.stop="unlikeFuns(item.id)" v-else>
                            <p class="iconfont icon-dianzan_kuai" style="color:red"> </p> <span> {{ item.count.count_liked +
                                1 }} </span>
                        </div>

                        <!-- 评论数量 -->
                        <div class="hande-content-btns">
                            <p class="iconfont icon-review"> </p> <span> {{ item.id == backNoteId
                                ? backlength : item.count.count_commented }} </span>
                        </div>
                        <!-- <p class="iconfont icon-fenxiang3"> <span> {{item.count.count_shared}} </span> </p> -->

                        <div class="hande-content-btns">
                            <van-cell class="iconfont icon-fenxiang3" @click="showShare = true" />
                            <span>{{ item.count.count_shared }} </span>
                        </div>

                        <van-share-sheet v-model:show="showShare" title="立即分享给好友" :options="options" @select="onSelect" />
                    </div>
                </div>
                <!-- <van-loading style="text-align: center;" size="30px" type="spinner">加载中...</van-loading> -->
                <!-- <van-loading size="24px" vstyle="text-align: center;line-height:40px;">加载中...</van-loading> -->
            </div>
        </div>




    </div>

    <!-- 主题手记内容 -->
    <div class="hande-box">
        <div class="topics-content" v-show="!isTopics">
            <div class="hande-title" v-for="(item, index) in newArr" :key="index">
                <span class="iconfont icon-xiangzuojiantou" @click="iswrite" v-show="!iswrite"></span>
                <span class="iconfont icon-xiangzuojiantou" v-show="!isTopics" @click="toTopics"></span>
                <!-- 主题名称 -->
                <h1 v-show="iswrite">{{ item.topics[0].name }}</h1>

                <h1 v-show="!iswrite">发手记 </h1>

                <!-- <span class="iconfont icon-yly_bianji" @click="iswrite" v-show="iswrite"> 写一条</span> -->

                <!-- <span class="release" @click="send" v-show="!show">发布</span> -->
            </div>

            <div class="empty-div" style="height:52px;background-color:#ffffff"></div>

            <!-- 手记内容 -->
            <div class="hande-show">

                <div class="hande-content" v-for="(item, index) in newArr" :key="index">
                    <!-- 用户头像 -->
                    <div class="head-pic">
                        <img :src="item.user.avatar + '?params50y50'" @click="toOthersInfo(item.user.id)">
                        <div class="user-box">
                            <div class="user-name">
                                <p class="name">{{ item.user.username }}
                                    <span class="iconfont icon-VIP1" v-if="item.user.vip_flag == 1"></span>
                                </p>
                                <p class="updata-time">{{ playerTime(item.addtime*1000) }} 发布</p>
                            </div>
                            <div class="flow-box">
                                <span class="flow" v-if="!idarr.includes(item.user.id)||!istoken" @click="increment(item.user.id)">
                                    + 关注 </span>
                                <span class="flow" v-else @click="incrementfalse(item.user.id)"> 已关注 </span>
                                <span class="iconfont icon-Androidgengduo"></span>
                            </div>
                        </div>
                    </div>
                    <!-- 手记描述 -->
                    <div class="content-desc" @click="toHanddetail(item.id)">
                        <p class="desc-title">{{ item.title }}</p>
                        <p class="desc-worlds">
                            <span class="desc-tag" v-if="item.topics"> # {{ item.topics[0].name }} </span>
                            {{ item.content }}
                        </p>
                        <!-- 图片 -->
                        <div class="desc-img">
                            <div class="img-boc" v-for="(item1, index1) in item.images" :key="index1">
                                <img :src="item1 + '?x-oss-process=image/format,webp'">
                            </div>
                        </div>
                        <!-- 视频 -->
                        <!--  -->
                        <!--  -->
                        <div class="desc-video" v-if="item.article.vid">
                            <div class="video-pic" v-if="dataArr[index].result">
                                <img :src="getimage(dataArr[index].result.data.cover + 'params50y50')">
                                <!-- <span class="iconfont icon-yanjing_xianshi_o"> 8779 </span>
                                <span class="iconfont icon-dianzan1"> 63 </span>
                                <span class="video-time"> 1:30</span> -->
                            </div>
                            <div class="video-card" v-if="dataArr[index].result">
                                <p class="video-name">{{ dataArr[index].result.data.title }}</p>
                                <p class="video-author">@{{ dataArr[index].result.data.owner.username }}</p>
                            </div>

                        </div>

                    </div>
                    <div class="hande-content-btn">
                        <!-- 主题点赞数量 -->
                        <div class="hande-content-btns" @click.stop="likeFuns(item.id)" v-if="!likearr.includes(item.id)||!istoken">
                            <p class="iconfont icon-dianzan"> </p> <span> {{ item.count.count_liked }} </span>
                        </div>
                        <div class="hande-content-btns" @click.stop="unlikeFuns(item.id)" v-else>
                            <p class="iconfont icon-dianzan_kuai" style="color:red"> </p> <span> {{ item.count.count_liked +
                                1 }} </span>
                        </div>
                        <!-- 主题评论数量 -->
                        <div class="hande-content-btns">
                            <p class="iconfont icon-review"> </p> <span> {{ item.id == backNoteId
                                ? backlength : item.count.count_commented }} </span>
                        </div>
                        <!-- <p class="iconfont icon-fenxiang3"> <span> {{item.count.count_shared}} </span> </p> -->

                        <div class="hande-content-btns">
                            <van-cell class="iconfont icon-fenxiang3" @click="showShare = true" />
                            <span>{{ item.count.count_shared }} </span>
                        </div>

                        <van-share-sheet v-model:show="showShare" title="立即分享给好友" :options="options" @select="onSelect" />
                    </div>
                </div>
            </div>

        </div>
    </div>




    <!-- 发手记的页面 -->
    <div class="send-note" v-show="!show1">
        <div class="sent-note-img">

            <van-uploader v-model="fileList" multiple />

        </div>

        <div class="sent-note-title">
            <input type="text" placeholder="填写标题可以获得更多推荐哦~" v-model="sentNoteTitle">
        </div>

        <div class="sent-note-content">
            <textarea cols="30" rows="10" placeholder="添加正文" id="noteContent" ref="noteContent"></textarea>
        </div>

    </div>
</template>

<style lang="scss">
.van-overlay.myoverlay {
    background-color: rgba(0, 0, 0, 0.8) !important;
}

.van-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.1) !important;
}

.wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    // height: 100%;
}

.block {
    // width: 120px;
    // height: 120px;
    background-color: #fff;
    height: 100%;
    display: flex;
    align-items: center;

    img {
        width: 375px;
        height: auto;
    }
}

* {
    padding: 0;
    margin: 0;
}

.hande-box {
    // height: 5000px;
    background-color: #f3f3f5;

    .hande-title {
        // position: relative;
        height: 42px;
        padding-top: 8px;
        border-bottom: 2px solid #f6f6f6;
        background-color: #ffffff;
        position: fixed;
        width: 100%;
        z-index: 999;

        h1 {
            font-size: 19px;
            font-weight: bolder;
            text-align: center;
            margin-top: 5px;
        }

        .release {
            display: inline-block;
            width: 80px;
            height: 29px;
            background-color: #f8eae7;
            color: #d24440;
            line-height: 29px;
            text-align: center;
            border-radius: 20px;
            font-weight: bold;
            font-size: 12px;
            position: absolute;
            right: 16px;
            top: 12px
        }

        .icon-xiangzuojiantou {
            display: inline-block;
            position: absolute;
            left: 16px;
            top: 19px
        }

        .icon-yly_bianji {
            display: inline-block;
            width: 80px;
            height: 29px;
            background-color: #f8eae7;
            color: #d24440;
            line-height: 29px;
            text-align: center;
            border-radius: 20px;
            font-weight: bold;
            font-size: 12px;
            position: absolute;
            right: 16px;
            top: 12px;

        }
    }

    .hane-rotate {
        padding-left: 16px;
        padding-bottom: 18px;
        background-color: #ffffff;

        .van-swipe-item {
            margin-top: 16px;
            width: 73px !important;
            margin-right: 10px;

            .swipe-img {
                img {
                    width: 73px;
                    height: 73px;
                    border-radius: 5px;
                }

                p {
                    -webkit-line-clamp: 1;
                    display: -webkit-box;
                    -webkit-box-orient: vertical;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    font-size: 13px;
                    margin-top: 8px;

                }
            }
        }

    }

    .hande-show {
        .hande-content {
            margin-top: 8px;
            background-color: #ffffff;
            padding-left: 16px;
            padding-top: 16px;
            padding-right: 16px;

            .head-pic {
                display: flex;

                img {
                    width: 40px;
                    height: 40px;
                    border-radius: 50%;
                    margin-right: 10px;
                }

                .user-box {
                    width: 90%;
                    display: flex;
                    justify-content: space-between;

                    .user-name {
                        .name {
                            // font-weight: bold;
                            font-size: 14px;

                        }

                        .updata-time {
                            color: #b0b0b2;
                            font-size: 10px;
                            margin-top: 7px;
                        }

                        .icon-VIP1 {
                            color: #e73f29;
                        }

                    }

                    .flow-box {
                        display: flex;
                        width: 68px;
                        align-items: center;
                        font-weight: 600;

                        .flow {
                            color: #e54e44;
                            font-size: 12px;
                            display: block;
                            width: 112px;

                        }

                        .icon-Androidgengduo {
                            color: #888888;
                            margin-left: 10px;
                            padding: 0px;
                        }
                    }
                }

            }

            .content-desc {
                margin-top: 16px;
                border-bottom: 2px solid #fafafa;
                padding-bottom: 10px;

                .desc-title {
                    font-size: 16px;
                    font-weight: bold;
                }

                .desc-worlds {
                    margin-top: 8px;
                    font-size: 14px;
                    -webkit-line-clamp: 3;
                    display: -webkit-box;
                    -webkit-box-orient: vertical;
                    overflow: hidden;
                    text-overflow: ellipsis;

                    .desc-tag {
                        color: #4d73cb;
                        font-size: 14px;
                    }
                }

                .desc-img {
                    display: flex;
                    // justify-content: space-between;
                    margin-top: 16px;
                    flex-wrap: wrap;

                    .van-button--primary {
                        border: none;
                        outline: none;
                        background-color: #b0b0b2;

                        img {
                            width: 110px !important;
                            height: 110px !important;
                            border-radius: 5px;

                        }
                    }

                    .img-boc {
                        width: 110px;
                        height: 110px;
                        border-radius: 5px;

                        overflow: hidden;
                        margin-bottom: 5px;
                        margin-right: 6px;

                        img {
                            width: 100%;
                            height: 100%;
                        }

                        &:nth-of-type(3),
                        &:nth-of-type(6),
                        &:nth-of-type(9) {
                            margin-right: 0px;
                        }
                    }

                }

                .desc-video {
                    margin-top: 12px;
                    display: flex;

                    .video-pic {
                        width: 160px;
                        height: 92px;
                        border-radius: 5px 0px 0px 5px;
                        overflow: hidden;
                        position: relative;

                        img {
                            width: 100%;
                            height: 100%;
                        }

                        span {
                            position: absolute;
                            // bottom: 10px;
                            top: 50%;
                            left:50%;
                            transform: translate(-50%,-50%);
                            color: #eee7e7;
                            font-size: 50px;
                        }

                        .video-time {
                            right: 10px;
                        }

                        .icon-yanjing_xianshi_o {
                            left: 10px;
                        }

                        .icon-dianzan1 {
                            left: 60px;
                        }

                    }

                    .video-card {
                        width: 184px;
                        height: 92px;
                        border-radius: 0px 5px 5px 0px;
                        background-color: #f3f4f6;
                        padding: 14px;
                        box-sizing: border-box;

                        .video-name {
                            font-size: 13px;
                            -webkit-line-clamp: 2;
                            display: -webkit-box;
                            -webkit-box-orient: vertical;
                            overflow: hidden;
                            text-overflow: ellipsis;
                        }

                        .video-author {
                            margin-top: 12px;
                            color: #95969b;
                            font-size: 12px;
                        }
                    }
                }
            }
        }

        .hande-content-btn {
            height: 41px;
            display: flex;
            align-items: center;
            justify-content: space-around;

            .hande-content-btns {
                display: flex;
                align-items: center;

                .van-cell {
                    padding: 0px;
                }
            }

            .icon-dianzan1,
            .icon-review,
            .icon-fenxiang3 {
                font-size: 17px;
                color: #605e6c;
            }

            span {
                font-size: 13px;
                color: #605e6c;
                margin-left: 5px;
            }

        }
    }
}

.send-note {
    width: 100%;
    height: 1000px;
    background-color: #ffffff;
    padding-left: 16px;
    padding-right: 16px;
    padding-top: 16px;
    box-sizing: border-box;


    .sent-note-img {
        width: 100%;

        .van-uploader__upload {
            width: 80px;
            height: 80px;
            // border-radius: 10px;
            border: 2px solid #f2f2f2;
        }

        .van-uploader__preview {
            width: 80px;
            height: 80px;
            margin-right: 7px;

            // border-radius: 10px;
            &:nth-of-type(4),
            &:nth-of-type(8) {
                margin-right: 0px;
            }

            .van-uploader__preview-image {
                width: 80px;
                height: 80px;

                // border-radius: 10px;
                img {
                    width: 80px;
                    height: 80px;
                    // border-radius: 10px;
                }
            }

        }

    }

    .sent-note-title {
        margin-top: 13px;

        input {
            outline: none;
            border: none;
            height: 46px;
            width: 100%;
            border-bottom: 2px solid #f2f2f2
        }
    }

    .sent-note-content {
        textarea {
            width: 100%;
            resize: none;
            outline: none;
            border: none;
            border-bottom: 2px solid #f2f2f2;
            padding-top: 20px;
        }
    }
}

.topics-content {
    @extend .hande-box;
}
</style>